<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
      xmlns:fn="http://xmlns.jcp.org/jsp/jstl/functions">
      

<ui:composition template="/template/default_template.xhtml">
	<ui:define name="head">
	<!--  Head Start  -->
  		<f:metadata>
  			<f:event type="preRenderView" listener="#{livroMB.initialize}"/>
  		</f:metadata>
  		<title><ui:insert name="title">Biblioteca Pessoal</ui:insert></title>
  	<!--  Head End  -->
	</ui:define>
	<ui:define name="container">
	<!-- Container Start -->
	
		<div class="panel panel-default">
		
  			<div class="panel-heading">
  				<span class="glyphicon glyphicon-book"></span>
  				Biblioteca
  			</div>
  			<div class="panel-body">
    			<p>Biblioteca de <h:outputText value="#{livroMB.usuario.nome}"></h:outputText> </p>
  			</div>
			<h:dataTable class="table" value="#{livroMB.livros}" var="livro" rendered="#{!empty livroMB.livros}">
				<h:column>
					<f:facet name="header">
						<h:outputText value="Nome do livro"></h:outputText>
					</f:facet>
					<h:outputText value="#{livro.titulo}"></h:outputText>
				</h:column>
				<h:column>
					<f:facet name="header">
						<h:outputText value="ISBN"></h:outputText>
					</f:facet>
					<h:outputText value="#{livro.isbn}"></h:outputText>
				</h:column>
				<h:column>
					<f:facet name="header">
						<h:outputText value="Ano de publicação"></h:outputText>
					</f:facet>
					<h:outputText value="#{livro.anoPub}"></h:outputText>
				</h:column>
				<h:column>
					<f:facet name="header">
						<h:outputText value="Usuário"></h:outputText>
					</f:facet>
					<h:outputText value="#{livro.usuario.nome}"></h:outputText>
				</h:column>
				<h:column>
					<f:facet name="header">
						<h:outputText value="Autores"></h:outputText>
					</f:facet>
					<h:outputText value="#{livro.listaAutores}"></h:outputText>
				</h:column>
			</h:dataTable>
			
  
		</div>
	
	
		
    		
    	
    	
    	<!-- Inicio Datatable -->
    	    	
	    	
    <!-- Fim DataTable  -->
    <!-- Fim Container -->			
	</ui:define>

</ui:composition>
</html>
